// replace:字符串替换，也可使用正则表达式
let s = "Visit Microsoft! Visit Microsoft!";
let reg = /Microsoft/g;
let res = s.replace("Microsoft", "Hello"); // 第一个Microsoft替换为Hello
let res2 = s.replace(reg, "Hello");
console.log(res); // Visit Hello! Visit Microsoft!
console.log(res2); // Visit Hello! Visit Hello!
